home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*
- * Copyright (C) 1991, Silicon Graphics, Inc.
- * All Rights Reserved.
- */
- /*
- * Miscellaneous graphics functions
- *
- * Routines:
- * check_pick ()
- * def_curs ()
- *
- * Jim Bennett
- * 1991
- */
-
- #include <gl/gl.h>
- #include "globj.h"
-
- #define MAXNAMES 100
- static short pickbuf [MAXNAMES] = {0};
-
- /*
- * check_pick - Check if any of the active controls were picked
- */
-
- check_pick ()
-
- {
- short *pickptr;
- int cnt;
- int picked;
-
- pickptr = pickbuf;
- picked = 0;
-
- /* Set picksize to require direct hit */
-
- picksize (1, 1);
- pick (pickptr, MAXNAMES);
- draw_scene (TRUE);
- endpick (pickptr);
-
- /* Scan through pick buffer, choose the last entry as the one */
-
- cnt = *pickptr;
- *pickptr++ = 0;
- while (cnt != 0)
- {
- while (cnt-- > 0)
- {
- picked = *pickptr;
- *pickptr++ = 0;
- }
- cnt = *pickptr;
- *pickptr++ = 0;
- }
-
- return (picked);
- }
-
- /*
- * def_curs - Define all of the cursors needed by synthia
- */
-
- static unsigned short curs_busy_1 [2] [16] =
- {
- {
- 0xffff, 0xffff, 0xc003, 0x6006,
- 0x300c, 0x1818, 0x0c30, 0x0660,
- 0x0660, 0x0c30, 0x1818, 0x300c,
- 0x6006, 0xc003, 0xffff, 0xffff
- },
-
- {
- 0x0000, 0x0000, 0x0ff0, 0x07c0,
- 0x0180, 0x0000, 0x0100, 0x0000,
- 0x0080, 0x0180, 0x03c0, 0x0380,
- 0x0000, 0x0000, 0x0000, 0x0000
- }
- };
-
- static unsigned short curs_busy_2 [2] [16] =
- {
- {
- 0xffff, 0xffff, 0xcff3, 0x67c6,
- 0x318c, 0x1818, 0x0d30, 0x0660,
- 0x06e0, 0x0db0, 0x1bd8, 0x338c,
- 0x6006, 0xc003, 0xffff, 0xffff
- },
-
- {
- 0x0000, 0x0000, 0x0ff0, 0x07c0,
- 0x0180, 0x0000, 0x0100, 0x0000,
- 0x0080, 0x0180, 0x03c0, 0x0380,
- 0x0000, 0x0000, 0x0000, 0x0000
- }
- };
-
- def_curs ()
-
- {
- curstype (C16X2);
- defcursor (BUSY_BEE_1, &curs_busy_1[0][0]);
- defcursor (BUSY_BEE_2, &curs_busy_2[0][0]);
- drawmode (CURSORDRAW);
- mapcolor (1, 224, 64, 64);
- mapcolor (2, WHITE_KEY_TOP);
- mapcolor (3, BLACK_KEY_TOP);
- drawmode (NORMALDRAW);
- }
-